home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Sumilidon.bin / mac / assets / sumilidon.dxr / 00052_Script_52 < prev    next >
Text File  |  2001-12-07  |  2KB  |  84 lines

  1. property mysprite, dx, dy, direction, coldbusted, pSpeed, counter, animate, countex
  2. global scorez, hit, placex, missed, randomvalue, stallamount
  3.  
  4. on beginsprite me
  5.   direction = "up"
  6.   pSpeed = 5
  7.   stallamount = 35
  8.   set mysprite to the spritenum of me
  9.   set dx to the locH of sprite mysprite
  10.   set dy to the locV of sprite mysprite
  11.   coldbusted = 1
  12.   counter = 0
  13. end
  14.  
  15. on exitframe me
  16.   
  17.   if coldbusted = 1 then
  18.     
  19.     if animate = 1 then
  20.       if counter < 1 then
  21.         set the member of sprite mysprite to "meda22"
  22.         counter = counter + 1
  23.       else
  24.         counter = 0
  25.         animate = 2
  26.       end if
  27.     else if animate = 2 then
  28.       if counter < 1 then
  29.         set the member of sprite mysprite to "meda23"
  30.         counter = counter + 1
  31.       else
  32.         animate = 0
  33.         counter = 0
  34.         set the locH of sprite mysprite = -200
  35.         set the member of sprite mysprite to "meda21"
  36.       end if
  37.     end if
  38.     if random(randomvalue) = randomvalue then
  39.       coldbusted = 2
  40.         end if
  41.     
  42.   else if coldbusted = 2 then
  43.     pSpeed = 2*random(5)
  44.     set the locV of sprite mysprite to dy
  45.     set the locH of sprite mysprite to dx
  46.     direction = "up"
  47.     coldbusted = 0
  48.   else
  49.     
  50.     if direction = "up" then
  51.       set the locV of sprite mysprite to the locV of sprite mysprite - pSpeed
  52.       if the locV of sprite mysprite < dy-120 then 
  53.         direction = "stall"
  54.       end if
  55.           else if direction = "stall" then
  56.       if countex > stallamount then
  57.         countex = 0
  58.         direction = "down"
  59.       else
  60.         set the loch of sprite mysprite to the locH of sprite mysprite
  61.         countex = countex + 1
  62.   end if 
  63.     else
  64.       set the locV of sprite mysprite to the locV of sprite mysprite + pSpeed
  65.       if the locV of sprite mysprite > dy then 
  66.         direction = "up"
  67.         missed = missed + 1
  68.         coldbusted = 1
  69.       end if
  70.     end if
  71.   end if
  72. end
  73.  
  74.  
  75. on mouseDown me
  76.   if coldbusted = 0 then
  77.     puppetsound "explosion"
  78.     hit = 1
  79.     animate = 1
  80.     coldbusted = 1
  81.     placex = the mouseLoc
  82.     scorez = scorez + 1
  83.   end if
  84. end